package com.soryin.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 开放平台 账号 实体
 * @author Hello_海生
 * @date 2014年3月21日
 */
@Entity
@Table(name="Soryin_openPlatforms")
public class OpenPlatform {
	private int id;
	private User userId;		//用户ID
	private String type;		// 开发平台类型
	private String sid;			// 用户 Token
	
	public OpenPlatform() {
		super();
		// TODO Auto-generated constructor stub
	}

	public OpenPlatform(int id, User userId, String type, String sid) {
		super();
		this.id = id;
		this.userId = userId;
		this.type = type;
		this.sid = sid;
	}
	
	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	@ManyToOne(fetch=FetchType.LAZY,cascade=CascadeType.ALL)
	@JoinColumn(name="userId")
	public User getUserId() {
		return userId;
	}
	public void setUserId(User userId) {
		this.userId = userId;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getSid() {
		return sid;
	}
	public void setSid(String sid) {
		this.sid = sid;
	}
	

	
	
	
}
